package com.tcl.launcherpro.lockscreen.statistics;


import com.tcl.launcherpro.lockscreen.BuildConfig;

import java.util.HashMap;

/**
 *<br>类描述：锁屏统计管理
 *<br>详细描述：
 *<br><b>Author sichard</b>
 *<br><b>Date 2017/4/19</b>
 */
public class LockReportManager {

    private static LockReportManager instance = new LockReportManager();

    private ILockReportMangerProxy mReportManagerProxy;

    public static LockReportManager getInstance() {
        return instance;
    }

    /**
     * 统计多项
     * @param key
     * @param valuesMap
     */
    public void onEvent(String key, HashMap<String, String> valuesMap) {
        if (mReportManagerProxy != null) {
            mReportManagerProxy.onEvent(key, valuesMap);
        }
    }

    /**
     * 统计单项
     * @param key
     */
    public void onEvent(String key) {
        if (mReportManagerProxy != null) {
            mReportManagerProxy.onEvent(key);
        }
    }

    /**
     * 带值单项统计
     * @param key
     * @param value
     */
    public void onEvent(String key,String value) {
        if (key != null && mReportManagerProxy != null) {
            mReportManagerProxy.onEvent(key, value);
        }
    }

    private boolean isDebug() {
        return BuildConfig.BUILD_TYPE.equalsIgnoreCase("debug");
    }

    public ILockReportMangerProxy getSearchPeport() {
        return mReportManagerProxy;
    }

    public void setSearchPeport(ILockReportMangerProxy mSearchPeport) {
        this.mReportManagerProxy = mSearchPeport;
    }
}
